/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.nmp.common;

/**
 *
 * @author ngotandieu
 */
public class UserData {

    String id;
    String email;
    String passwdMD5;
    String app;
    String app_user_id;
    String avatar;
    String name;
    int gender;
    long dob;
    String link;
    long created;

    public UserData() {
        this.name = "";
        this.email = "";
        this.passwdMD5 = "";
        this.created = 0;
        this.app = "";
        this.app_user_id = "";
        this.avatar = "";
        this.gender = 0;
        this.dob = 0;
        this.link = "";
    }

    public UserData(String name, String email, String pass) {
        this.name = name.toLowerCase().trim();
        this.email = email.toLowerCase().trim();
        this.passwdMD5 = CommonUtil.md5(pass);
        this.created = System.currentTimeMillis();
        this.app = "";
        this.app_user_id = "";
        this.avatar = "";
        this.gender = 0;
        this.dob = 0;
        this.link = "";
    }

    public UserData(String id, String app, String app_user_id, String avatar, String name, int gender, long dob, String link) {
        this.id = id;
        this.app = app;
        this.app_user_id = app_user_id;
        this.avatar = avatar;
        this.name = name;
        this.gender = gender;
        this.dob = dob;
        this.link = link;
    }

    public UserData(String id, String name, String email, String passwdMD5, long created) {
        this.id = id;
        this.name = name.toLowerCase();
        this.email = email.toLowerCase();
        this.passwdMD5 = passwdMD5;
        this.created = created;
        this.app = "";
        this.app_user_id = "";
        this.avatar = "";
        this.gender = 0;
        this.dob = 0;
        this.link = "";
    }

    public UserData(String id, String email, String passwdMD5, String app, String app_user_id, String avatar, String name, int gender, long dob, String link, long created) {
        this.id = id;
        this.email = email;
        this.passwdMD5 = passwdMD5;
        this.app = app;
        this.app_user_id = app_user_id;
        this.avatar = avatar;
        this.name = name;
        this.gender = gender;
        this.dob = dob;
        this.link = link;
        this.created = created;
    }

    public String getLink() {
        return link;
    }

    public String getApp_user_id() {
        return app_user_id;
    }

    public void setApp_user_id(String app_user_id) {
        this.app_user_id = app_user_id;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public String getApp() {
        return app;
    }


    public String getAvatar() {
        if (avatar.equalsIgnoreCase("")) {
            return "default.png";
        }
        return avatar;
    }

    public int getGender() {
        return gender;
    }

    public long getDob() {
        return dob;
    }

    public void setApp(String app) {
        this.app = app;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public void setGender(int gender) {
        this.gender = gender;
    }

    public void setDob(long dob) {
        this.dob = dob;
    }

    public String getId() {
        return id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public String getEmail() {
        return email;
    }

    public String getPasswdMD5() {
        return passwdMD5;
    }

    public long getCreated() {
        return created;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setEmail(String email) {
        this.email = email.trim();
    }

    public void setPasswdMD5(String passwdMD5) {
        this.passwdMD5 = passwdMD5;
    }

    public void setCreated(long created) {
        this.created = created;
    }
}
